﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO.Ports;
using Gadgeteer.Interfaces;

namespace Gadgeteer.Modules.Community.XBee.Test.Unit
{
    public class MockSerialLine : Serial
    {
        public Queue<byte> FakeBuffer { get; set; }

        public override int BytesToRead
        {
            get { return FakeBuffer.Count; }
        }

        public void RaiseBytesReceivedEvent()
        {
            OnDataReceivedEvent(this, SerialData.Chars);
        }

        public override int ReadByte()
        {
            return FakeBuffer.Dequeue();
        }
    }
}
